﻿using System;
using System.Collections.Generic;
using Ease.EaseNode.Runtime;
using Sirenix.OdinInspector;
using UnityEngine;

namespace Ease.EaseMission.Runtime
{
    [Serializable]
    public partial class MissionData : BaseEaseNodeData, IMissionData
    {
        [SerializeField] [OnValueChanged(nameof(OnAnyValueChange))]
        private int id;

        [SerializeField] [OnValueChanged(nameof(OnAnyValueChange))]
        private string name;

        public int Id
        {
            get => id;
            set => id = value;
        }

        public string Name
        {
            get => name;
            set => name = value;
        }

        [SerializeReference] [OnValueChanged(nameof(OnAnyValueChange))]
        private IMissionParam param;

        public IMissionParam Param => param;

        [SerializeField] private List<string> preIds = new List<string>();
        public List<string> PreIds => preIds;
        [SerializeField] private List<string> nextIds = new List<string>();
        public List<string> NextIds => nextIds;

        public string Tip => $"[{id}][{name}]";

        protected override IEaseNodeAgent OnCreateAgent()
        {
            return new MissionDataHandler(this);
        }
    }
}